<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script>
    /*
    *  1.制定匹配模式1:
         var 变量名 = new RegExp("正则","匹配模式")

       2.制定匹配模式2:
         var 变量名 = /正则/匹配模式
    * */

    var regex = /^abcd$/i;
    var result01 = regex.test("ABCD");
    console.log(result01);
</script>
</html>